fix(kb): fix Linear connector GraphQL type errors and tag slot reuse#3919
fix(kb): fix Linear connector GraphQL type errors and tag slot reuse#3919waleedlatif1 merged 5 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates the Linear connector’s GraphQL queries to use Reviewed by Cursor Bugbot for commit 6e0d016. Configure here. |
Greptile SummaryThis PR delivers two targeted bug fixes for the knowledge base connector system:
Key changes:
Confidence Score: 5/5Safe to merge — both fixes are targeted, correct, and well-scoped with no regressions introduced The Linear type change (String! → ID!) directly matches Linear's GraphQL schema and eliminates the 400 errors. The tag slot reuse logic correctly separates existing-slot reuse from new-slot allocation, only writing new knowledgeBaseTagDefinitions rows to the DB. The fieldType guard on reuse prevents mismatched slot types. No P0 or P1 findings; the PR is clean. No files require special attention Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Route as POST /api/knowledge/[id]/connectors
participant DB
participant Linear as Linear GraphQL API
Client->>Route: POST with connectorType, credentialId, sourceConfig
Route->>DB: Query existing knowledgeBaseTagDefinitions
DB-->>Route: existingDefs (tagSlot, displayName, fieldType)
Note over Route: Build existingByName map<br/>Separate reused vs new defs
Route->>Route: allocateTagSlots(defsNeedingSlots, usedSlots)
Route->>DB: BEGIN TRANSACTION, LOCK knowledge_base row
Route->>DB: createTagDefinition (new slots only)
Route->>DB: INSERT knowledgeConnector (with full tagSlotMapping)
DB-->>Route: OK
Route->>Route: dispatchSync(connectorId)
Route-->>Client: 201 Created
Note over Linear: During sync
Route->>Linear: ListIssues ($teamId: ID!, $projectId: ID!)
Linear-->>Route: Issues page
Route->>Linear: GetIssue ($id: ID!)
Linear-->>Route: Issue detail
Reviews (2): Last reviewed commit: "fix(kb): verify field type when reusing ..." | Re-trigger Greptile |
Clean up newTagSlotMapping into direct assignment, remove unnecessary comment, and revert ID! back to String! to match Linear SDK types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add fieldType check to the tag slot reuse logic so a connector with a matching displayName but different fieldType falls through to fresh slot allocation instead of silently reusing an incompatible slot. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6e0d016. Configure here.
…3919) * fix(kb): fix Linear connector GraphQL type errors and tag slot reuse * fix(kb): simplify tag slot reuse, revert Linear GraphQL types to String Clean up newTagSlotMapping into direct assignment, remove unnecessary comment, and revert ID! back to String! to match Linear SDK types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(kb): use ID! type for Linear GraphQL filter variables * fix(kb): verify field type when reusing existing tag slots Add fieldType check to the tag slot reuse logic so a connector with a matching displayName but different fieldType falls through to fresh slot allocation instead of silently reusing an incompatible slot. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(kb): enable search on connector selector dropdowns --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
String!toID!for team/project filter comparators and issue lookupType of Change
Testing
Tested manually
Checklist